package service

import (
	"github.com/gin-gonic/gin"
	"zk2/product-guard/internal/dto"
	"zk2/product-guard/internal/model"
	"zk2/product-guard/response"
)

func CreateOrderStatus(c *gin.Context) {

	var OrderStatus model.OrderStatus
	err := c.ShouldBind(&OrderStatus)
	if err != nil {
		response.Error(c, "参数错误")
		return
	}
	OrderStatus = model.OrderStatus{
		OrderId:   OrderStatus.OrderId,
		UserToken: OrderStatus.UserToken,
	}
	err = dto.CreateOrderStatus(&OrderStatus)
	if err != nil {
		response.Error(c, "无效token")
		return
	}
	response.Success(c, "有效token", OrderStatus.UserToken)
}
